package com.cz.kingdee.prod;

import com.cz.kingdee.KingdeeClient;
import com.cz.kingdee.dto.OrgDTO;
import com.kingdee.bos.webapi.entity.QueryParam;
import com.kingdee.bos.webapi.sdk.K3CloudApi;

import java.util.List;

public class QueryOrg {
    public static void main(String[] args) throws Exception {
        KingdeeClient client = new KingdeeClient();
        K3CloudApi k3CloudApi = client.getProdKingdeeClient();
        QueryParam queryParam = new QueryParam();
        queryParam.setFormId("ORG_Organizations");
        queryParam.setFieldKeys("FOrgID,FName,FNumber");
        List<OrgDTO> orgList = k3CloudApi.executeBillQuery(queryParam, OrgDTO.class);
        for (OrgDTO org : orgList) {
            System.out.println(org.getFOrgID() + " " + org.getFName() + " " + org.getFNumber());
        };
    }
}
